﻿using CommunityToolkit.Mvvm.ComponentModel;

namespace TotalApplication.Core
{
    public partial class ChatMessageListItemViewModel : BaseViewModel
    {
        #region Public properties
        [ObservableProperty]
        private string? _senderName;

        [ObservableProperty]
        private string? _message;

        [ObservableProperty]
        private string? _initial;

        /// <summary>
        /// The RGB values for the background color of the profile picture.
        /// </summary>
        [ObservableProperty]
        private string? _profilePictureRGB;

        [ObservableProperty]
        private bool _newContentAvailable;

        [ObservableProperty]
        private bool _isSelected;

        [ObservableProperty]
        private bool _sentByMe;

        [ObservableProperty]
        private DateTimeOffset _messageReadTime;

        public bool MessageRead => MessageReadTime > DateTimeOffset.MinValue;

        [ObservableProperty]
        private DateTimeOffset _messageSentTime;

        [ObservableProperty]
        private bool _newItem = false;

        [ObservableProperty]
        private ChatMessageListImageItemViewModel? _imageAttachment;

        public bool HasMessage => Message != null;

        public bool HasImageAttachment => ImageAttachment != null;


        #endregion

    }
}
